Skip to main content

7. API Specification Details

  1. NEPALPAY QR APIs will be exposed through National Payments Interface. All the security features of NPI will be inherited by these APIs. Validation, Payment, Refund and Reporting are the types of APIs that will be exposed in NPI.
  2. Acquirer or Acquirer network shall expose payment confirmation API for receiving confirmation of payments. It shall also expose merchant validation API at its side.
  3. Issuer or Issuer network shall expose refund API at its side for receiving refund related messages.
  4. Critical information will be encrypted using the pre-shared public keys and token signing will be performed in every message.
  5. Specifications of the APIs are tabulated in the following sections.

7.1 Validate API

Post: /nQR/v1/validate

This is the first process of QR payment. App or instrument in the issuer network side will capture the complete QR string, which is then passed to the validation API as an input. The API will response back with the parsed and validated details about the merchant and payment. This API will be optional for the Acquirers to respond, in which case the NPI will simply parse the message and respond back to the Issuer. Issuer network should include all the fields obtained from validation API along with other payment details during the payment API call.

Example Image

  1. Customer scans the QR code displayed by the merchant using its mobile application. The captured details will be sent to NPI for validation.
  2. NPI will connect to the acquiring network for the merchant validation, which includes validation for merchant, Merchant Category Code (MCC), Merchant Name and other information, if any.
  3. Acquiring entity will perform the necessary validation and respond back to NPI.
  4. NPI passes the validation information/status to the originating channel.

7.1.1. Request from Issuer Network to NPI

#Data ItemsTypeLengthRequiredRemarks
1instructionIdString20MUnique reference id to trace the request by issuer
2qrStringStringMQR String captured from the QR Code.

Sample request:

{
"instructionId":"val-1122",
"qrString":"<QR String>”
}

7.1.2. Request from NPI to Acquirer Network (For Validation)

#Data ItemsTypeLengthRequiredRemarks
1validationTraceIdString20MUnique QR validation/parse Id provided by NCHL.
2instructionIdString20MUnique reference id to trace the request by issuer
3qrTypeStringMTo differentiate dynamic and static QR
4acquirerIdStringMAcquirer of the QR code
5acquirerCountryCodeString2MCountry Code NP (NEPAL)
6merchantPanStringMMerchant PAN encrypted with the public key provided by acquirer.
7merchantCategoryCodeString4MMerchant Category Code
8amountNumeric (12,2)MAmount. 0.00 if none.
9transactionFeeNumeric (10,2)MTransaction Fee, if the transaction costs additional fee for the customer. 0.00 if none.
10currencyCodeStringMCurrency symbol (e.g., NPR for Nepali rupee)
11merchantNameStringMMerchant Name
12merchantCityStringMCity
13merchantCountryCodeString2MCountry Code NP (NEPAL)
14merchantPostalcodeStringMMerchant’s Zip Code/Pin Code/Postal Code
15merchantBillNoStringMBill No of merchant. 0 if none.
16merchantTxnRefStringCTxn ref of merchant
17TerminalStringOTerminal id of the QR code.0 if none.
18qrStringStringOQR String captured from the QR Code
19encKeySerialStringMSerial number of the public key used for encryption above.
20addenda1 - addenda10StringOAdditional fields 1 to 10 for future usages.
21networkStringMNetwork identifier for the issuer network (e.g., NQR)
22tokenStringMSHA 256 Signature token
Token String= validationTraceId+”,”+instructionId+“,”+acquirerId+”,”+merchantPan+”,”+merchantCategoryCode+”,”+amount+
,”+transactionFee+”,”+currencyCode+”,”+merchantName+”,”+merchantBillNo+”,”+terminal"
Note: merchantPan in token string will be in plain text format. merchantPan received in QR validation request from NPI first have to decrypt with the acquirer private key.

For signature token verification, use NCHL public key.

Request Sample

{
"validationTraceId":"2107280000000075KLO",
"instructionId": "CIPS-12070",
"acquirerId": "00010001",
"acquirerCountryCode":"NP",
"merchantPan": "<Encrypted Merchant Pan>",
"merchantCategoryCode":5143,
"qrType": "STATIC",
"amount": 1000.23,
"transactionFee": 2,
"interchangeFee":5,
"network": "NQR",
"currencyCode": "NPR",
"merchantBillNo": "B32568",
"merchantTxnRef": "NQR-610",
"merchantCountryCode": "NP",
"merchantCity":"Kathmandu",
"merchantName": "ABC Store",
"terminal": "10",
"addenda1":" addnField1 test data",
"addenda2":" addnField2 test data",
"addenda10":" addnField10 test data",
"encKeySerial": "517927635424121769165481",
"token": "<signature token>"
}

7.1.3. Response from Acquirer Network to NPI

#Data ItemsTypeLengthRequiredRemarks
1responseCodeString10MResponse code for the validation request
2responseMessageString200MHuman readable message for the response code.
3validationTraceIdString20MUnique QR validation/parse Id provided by NCHL.
4instructionIdString20MUnique reference id to trace the request by issuer
5qrTypeStringMTo differentiate dynamic and static QR
6acquirerIdStringMAcquirer of the QR code
7acquirerCountryCodeString2MCountry Code NP (NEPAL)
8merchantPanStringMMerchant PAN encrypted with the public key of NCHL.
9merchantCategoryCodeString4MMerchant Category Code
10AmountNumeric (12,2)MAmount. 0.00 if none.
11transactionFeeNumeric (10,2)MTransaction Fee, if the transaction costs additional fee for the customer. 0.00 if none.
12currencyCodeStringMCurrency symbol (e.g., NPR for Nepali rupee)
13merchantNameStringMMerchant Name
14merchantCityStringMCity
15merchantCountryCodeString2MCountry Code NP (NEPAL)
16merchantPostalcodeStringMMerchant’s Zip Code/Pin Code/Postal Code
17merchantBillNoStringMBill No of merchant. Else 0
18merchantTxnRefStringCTxn ref of merchant
19TerminalStringOTerminal id of the QR code. Else 0
20encKeySerialStringMSerial number of the public key used for encryption above.
21addenda1 - addenda10StringOAdditional fields 1 to 10 for future usages.
22networkStringMNetwork identifier for the QR code
23tokenStringMSHA 256 Signature token
Token String=validationTraceId+”,”+instructionId+“,”+ acquirerId+”,”+merchantPan+”,”+merchantCategoryCode+”,
+amount+”,”+transactionFee+”,” +currencyCode+”,”+merchantName+”,”+merchantBillNo+”,”+terminal+”,”+responseCode
Note: merchantPan in token string will be in plain text. merchantPan received in QR validation request first have to decrypt with the acquirer private key. And again, have to encrypt with NCHL public key and send back to validation response message.

For signature token signing, use acquirer private key.

Response Sample

{
"responseCode":"000",
"responseMessage":"QR Validation Successful",
"validationTraceId":"2107280000000075KLO",
"instructionId": "CIPS-12070",
"acquirerId": "00010001",
"acquirerCountryCode":"NP",
"merchantPan": "<Encrypted Merchant Pan>",
"merchantCategoryCode":5143,
"qrType": "STATIC",
"amount": 1000.23,
"transactionFee": 2,
"interchangeFee":5,
"network": "NQR",
"currencyCode": "NPR",
"merchantBillNo": "B32568",
"merchantTxnRef": "NQR-610",
"merchantCountryCode": "NP",
"merchantCity":"Kathmandu",
"merchantName": "ABC Store",
"terminal": "10",
"addenda1":" addnField1 test data",
"addenda2":" addnField2 test data",
"addenda10":" addnField10 test data",
"encKeySerial": "58779633335424121769",
"token": "<signature token>"
}

7.1.4. Response from NPI to Issuer Network

#Data ItemsTypeLengthRequiredRemarks
1responseCodeString10MResponse code for the validation request
2responseMessageString200MHuman readable message for the response code
3validationTraceIdString20MUnique QR validation/parse Id provided by NCHL
4instructionIdString20MUnique reference id to trace the request by issuer
5qrTypeStringMTo differentiate dynamic and static QR
6acquirerIdStringMAcquirer of the QR code
7acquirerCountryCodeString2MCountry Code NP (NEPAL)
8merchantPanStringMMerchant PAN encrypted with the public key provided by Issuer
9merchantCategoryCodeString4MMerchant Category Code
10amountNumeric(12,2)MAmount. 0.00 if none
11transactionFeeNumeric(10,2)MTransaction Fee, if the transaction costs additional fee for the customer. 0.00 if none
12currencyCodeStringMCurrency symbol (eg. NPR for Nepali rupee)
13merchantNameStringMMerchant Name
14merchantCityStringMCity
15merchantPostalCodeStringMMerchant’s Zip Code/Pin Code/Postal Code
16merchantCountryCodeString2MCountry Code NP (NEPAL)
17merchantBillNoStringMBill No of merchant. Else 0
18merchantTxnRefStringCTxn ref of merchant
19terminalStringOTerminal id of the QR code
20encKeySerialStringMSerial number of the public key used for encryption above.
21addenda1-addenda10StringOAdditional fields 1 to 10 for future usages
22networkStringMNetwork identifier for the QR code
23tokenStringMSHA 256 Signature token.
Token String=validationTraceId+”,”+instructionId“,”+acquirerId+”,”+merchantPan +”,”+merchantCategoryCode+”,”+amount+”,
+transactionFee+”,”+currencyCode+”,”+merchantName+”,”+merchantBillNo+”,”+terminal+”,”+responseCode
Note: merchantPan in token string will be in plain text. merchantPan received in QR validation response from NPI have to first decrypt with the issuer private key.

For signature token verification, use NCHL public key.

Response Sample

{
"responseCode":"000",
"responseMessage":"QR Validation Successful",
"validationTraceId":"2107280000000075KLO",
"instructionId": "CIPS-12070",
"acquirerId": "00010001",
"acquirerCountryCode":"NP",
"merchantPan": "<Encrypted Merchant Pan>",
"merchantCategoryCode":5143,
"qrType": "STATIC",
"amount": 1000.23,
"transactionFee": 2,
"interchangeFee":5,
"network": "NQR",
"currencyCode": "NPR",
"merchantBillNo": "B32568",
"merchantTxnRef": "NQR-610",
"merchantCountryCode": "NP",
"merchantCity":"Kathmandu",
"merchantName": "ABC Store",
"terminal": "10",
"addenda1":" addnField1 test data",
"addenda2":" addnField2 test data",
"addenda10":" addnField10 test data",
"encKeySerial": "9865752335424121769165481",
"token": "<signature token>"
}

7.2. Payment API

Post: /nQR/v1/payment

Once the validation is successful, originating channel will use the Payment API, exposed in NPI for initiating a payment transaction. In the case of static QR, users should be enforced to enter the amount before calling the payment API, where as the amount will be pre-populated in case of dynamic QR.

Example Image

  1. Issuer channel will send a transaction request to Issuer network, which will send to NPI for initiating a payment, after it customer confirms the merchant and other details.
  2. NPI will route the request to corresponding bank for debit.
  3. On debit success, acquirer network’s payment confirmation API will be called.
  4. NPI will send the notification to the originating channel.

As a sub process of payment API, NPI will first perform the debit through CIPS switch. The debit account will depend upon the channel (for PSP: settlement account of PSP, for CIPS/mobile banking: account of the customer). The inter-bank settlement of funds on multilateral net basis will be done in RTGS system. NCHL will send NCP file to RTGS system through NSI module. Settlement account of BFI (could be Issuer or Issuer associated bank) will be debited and settlement account of BFI (could be acquirer or acquirer associated bank) will be credited. Credit to acquirer (BFIs, PSPs, aggregators) will be performed on deferred basis.

7.2.1. Request from Issuer Network to NPI

#Data ItemsTypeLengthRequiredRemarks
1instructionIdString20MUnique reference id to trace the request by issuer
2validationTraceIdString20MUnique QR validation/parse Id provided by NCHL
3acquirerIdStringMAcquirer of the QR code
4merchantPanStringMMerchant Id encrypted with public key provided by NCHL
5qrTypeENUMMStatic or Dynamic
6amountNumeric(12,2)MAmount
7interchangeFeeNumeric(10,2)MCharge if applicable else 0.00
8transactionFeeNumeric(10,2)MIF additional cost to be paid by the customer for the transaction. else 0.00
9currencyCodeString3MCurrency symbol (eg. NPR)
10merchantBillNoString15MRequired if qrType is dynamic. 0 if none
11payerNameString200MName of the payer
12payerPanIdStringMMobile Number or User Id, etc uniquely identifying payer in issuer system, encrypted with public key provided by NCHL
13payerMobileNumberStringMMobile No of Payer
14payerEmailAddressStringOPayer Email Address
15issuerIdStringMIssuer id
16debtorAccountStringMDebit account number.
17debtorAgentString4MBank Id
18debtorAgentBranchString4MBranch Id of Debtor Agent.
19narrationStringMax 20ONarration if any
20acquirerCountryCodeString2MCountry Code NP (NEPAL)
21merchantNameStringMMerchant Common Name
22merchantCityStringMMerchant City
23merchantPostalCodeStringMMerchant’s Zip Code/Pin Code/Postal Code
24merchantCountryCodeString2MCountry Code NP (NEPAL)
25localTransactionDateTimeStringMYYYYMMDDHHmmssSSS
26merchantCategoryCodeString4MMerchant category code (MCC)
27merchantTxnRefStringOMerchant Transaction Reference
28instrumentENUMMCIPS-connectIPS, MOB-Mobile Banking, WAL-Wallet
29terminalStringOTerminal id of the QR code
30encKeySerialStringMSerial number of the public key used for encryption above
31addenda1-addenda10StringOAdditional fields 1 to 10 for future usages
32networkStringMNetwork identifier for the QR code
33tokenStringMSHA 256 Signature token
Token String=validationTraceId+”,”+instructionId+“,”+ acquirerId+”,”+ merchantPan +”,”+merchantCategoryCode+”,”+amount+”,”+
transactionFee+”,”+interchangeFee+”,”+currencyCode+”,”+merchantName+”,”+merchantBillNo+”,”+terminal+”,”+issuerId+”,”+payerName+”,”+
debtorAgent+”,”+debtorAccount
Note: merchantPan in token string will be in plain text. merchantPan received in validation response first have to decrypt with the issuer private key. And again, have to encrypt with NCHL public key and send in a payment request.

For signature token signing, use issuer private key

Request Sample:

{
"instructionId": "HBLQR-1628503975494",
"validationTraceId": "2108090000000147KFQ",
"acquirerId": "00000701",
"merchantPan": "<Encrypted Merchant PAN>",
"qrType": "DYNAMIC",
"amount": 10050.0,
"interchangeFee": 5.0,
"transactionFee": 0.0,
"currencyCode": "NPR",
"merchantBillNo": "001",
"payerName": "SABINA JOSHI",
"payerPanId": "<Encrypted Payer PAN>",
"payerMobileNumber": "9841******",
"payerEmailAddress": null,
"issuerId": "00000701",
"debtorAccount": "01908504580011",
"debtorAgent": "0701",
"debtorAgentBranch":"1",
"narration": "test",
"acquirerCountryCode": "NP",
"merchantName": "Kathmandu Cafe",
"merchantCity": "Kathmandu",
"merchantCountryCode": "NP",
"localTransactionDateTime": "20210905115532458",
"merchantCategoryCode": 1235,
"merchantTxnRef": "txn ref",
"instrument": "MOB",
"terminal": "Terminal1",
"encKeySerial": "170069681833763609248238",
"token": "<Signature Token>",
"merchantPostalCode": "44601",
"addenda1":" addnField1 test data",
"addenda2":" addnField2 test data",
"addenda10":" addnField10 test data"
}

7.2.1.1. Payment API For Debit Bypass Workflow

Post: /nQR/v1/payment/dnrq

Once QR validation is successful, originating channel will use the Payment API, exposed in NPI for initiating a payment transaction. In the case of static QR, users should be enforced to enter the amount before calling the payment API, whereas the amount and other details will be pre-populated in case of dynamic QR. In case of debit not required workflow, issuer network first have to debit the customer account (after getting the successful merchant validation response) prior to sending the payment request. NEPALPAY QR network will consider all the payments request received from issuer network as a debit success and routes further for credit leg only.

  1. After user confirms the payment, issuer instrument will send a payment request to issuer switch/network for debiting the customer account. Once customer account is debited successfully, payment have to be routed further to NPI/NPS switch for crediting the merchant settlement account at acquirer bank.

  2. For debit bypass workflow, NPI will consider all the payment request received from issuer channel are as debit success.

  3. After the credit leg of the transaction is successful and payment notification is given to the acquirer network, NPI will provide the payment confirmation notification to the originating issuer channel.

Payment Request from Issuer Network to NPI

33categoryPurposeString4CDNRQcategory purpose to be used for debit bypass QR payment flow.

Request Sample:

The category purpose code “DNRQ” to be added in the request payload from Issuer network to NPI.

{
…………………………………….
………………………………………..
"categoryPurpose": "DNRQ"
…………………………………….
………………………………………..
}

7.2.2. Request from NPI to Acquirer Network

#Data ItemsTypeLengthRequiredRemarks
1nQrTxnIdString20MUnique payment transaction id generated by NCHL
2validationTraceIdString20MUnique QR validation/parse Id provided by NCHL
3instructionIdString20MUnique reference id to trace the request by issuer
4acquirerIdStringMAcquirer of the QR code
5merchantPanStringMMerchant Id encrypted with public key provided by acquirer
6qrTypeStringMStatic or Dynamic
7amountNumeric(12,2)MAmount
8interchangeFeeNumeric(10,2)MCharge if applicable else 0.00
9transactionFeeNumeric(10,2)MTransaction Fee, if the transaction costs additional fee for the customer. Else 0.00
10currencyCodeString3MCurrency symbol (eg. NPR)
11merchantBillNoString15MRequired if qrType is dynamic. Else 0
12merchantTxnRefStringOMerchant Transaction Reference
13payerMobileNumberString10MMobile Number of customer
14payerNameString200MName of the payer
15issuerIdStringMIssuer id
16localTransactionDateTimeStringMYYYYMMDDHHmmssSSS
17creditStatusStringMReceiver Account Credit status
18narrationStringMax 20ONarration, if any
19sessionSrlNoIntegerMSession number of the transaction processed
20terminalStringTerminal id of the QR code. Else 0
21encKeySerialStringMSerial number of the public key used for encryption above
22addenda1-addenda10StringOAdditional fields 1 to 10 for future usages
23networkStringMNetwork identifier for QR network
24merchantCategoryCodeString4MMerchant Category Code
25merchantNameStringMMerchant Common Name
26tokenStringMSHA 256 Signature token
27issuerNetworkStringMNetwork identifier for the issuer network
Token String=nQrTxnId+”,”+validationTraceId+”,”+instructionId+“,”+acquirerId+”,” + merchantPan+”,”+merchantCategoryCode+”,”+
amount+”,” +transactionFee+”,”+interchangeFee+”,”+currencyCode+”,”+merchantName+”,”+merchantBillNo+”,”+terminal+”,”+issuerId+”,”+payerName
Note: merchantPan in token string will be in plain text. merchantPan received in payment request first have to decrypt with the acqirer private key.

For signature token verification, use NCHL public key.

Request Sample:

{
"issuerNetwork": "NQR",
"merchantCountryCode": "NP",
"merchantPan": "<Encrypted Merchant PAN>",
"merchantBillNo": "0",
"merchantName": "Nepal Cafe1",
"network": "NQR",
"issuerId": "00000701",
"validationTraceId": "2110010000000397EYM",
"payerName": "SABINA JOSHI",
"acquirerId": "00010001",
"localTransactionDateTime": "20210905205689635",
"amount": 200,
"merchantCity": "Kathmandu",
"encKeySerial": "1234567890",
"acquirerCountryCode": "NP",
"terminal": "0",
"creditStatus": "DEFER",
"token": "<Signature Token>",
"transactionFee": 0,
"interchangeFee": 2,
"sessionSrlNo": 1485,
"narration": "Test",
"merchantCategoryCode": 5814,
"qrType": "STATIC",
"instructionId": "HBLQR-1633070857505",
"currencyCode": "NPR",
"payerMobileNumber": "9841******",
"addenda1":" addnField1 test data",
"addenda2":" addnField2 test data",
"addenda10":" addnField10 test data"
}

7.2.3. Response from Acquirer network to NPI

#Data ItemsTypeLengthRequiredRemarks
1nQrTxnIdString20MUnique payment transaction id generated by NCHL
2validationTraceIdString20MUnique QR validation/parse Id provided by NCHL
3instructionIdString20MUnique reference id to trace the request by issuer
4acquirerIdStringMAcquirer of the QR code
5merchantPanStringMMerchant Id encrypted with public key provided by NCHL
6qrTypeStringMStatic or Dynamic
7AmountNumeric(12,2)MAmount
8interchangeFeeNumeric(10,2)MCharge if applicable else 0.00
9transactionFeeNumeric(10,2)MTransaction Fee, if the transaction costs additional fee for the customer. Else 0.00
10currencyCodeString3MCurrency symbol (eg. NPR)
11merchantBillNoString15MRequired if qrType is dynamic else 0
12merchantTxnRefStringOMerchant Transaction Reference
13payerMobileNumberString10MMobile Number of customer
14payerNameString200MName of the payer
15issuerIdStringMIssuer id
16localTransactionDateTimeStringMYYYYMMDDHHmmssSSS
17creditStatusStringMReceiver Account Credit status
18narrationStringMax 20ONarration, if any
19sessionSrlNoIntegerMSession number of the transaction processed
20terminalStringOTerminal id of the QR code. Else 0
21encKeySerialStringMSerial number of the public key used for encryption above
22responseCodeStringMResponse code for the confirmation
23responseMessageStringOHuman readable message for the response code
24addenda1-addenda10StringOAdditional fields 1 to 10 for future usages
25networkStringMNetwork identifier for QR network
26merchantCategoryCodeString4MMerchant Category Code
27merchantNameStringMMerchant Common Name
28tokenStringMSHA 256 Signature token
29issuerNetworkStringMNetwork identifier for the issuer network
Token String=nQrTxnId+”,”+validationTraceId+”,” +instructionId+ “,” + acquirerId +”,” + merchantPan +”,”+merchantCategoryCode+”,”+
amount+”,”+transactionFee+”,”+interchangeFee+”,”+currencyCode+”,”+merchantName+”,”+merchantBillNo+”,”+terminal+”,”+issuerId+”,”+payerName+”,”+responseCode
Note: merchantPan in token string will be in plain text. merchantPan received in payment request first have to decrypt with the acqirer private key. And again, have to encrypt with NCHL public key and send back in payment confirmation response.

For signature token verification, use acquirer private key.

Response Sample

{
"responseCode":"000",
"responseMessage":"Payment Transaction Successful",
"issuerNetwork": "NQR",
"merchantCountryCode": "NP",
"merchantPan": "<Encrypted Merchant PAN>",
"merchantBillNo": "0",
"merchantName": "Nepal Cafe1",
"network": "NQR",
"issuerId": "00000701",
"validationTraceId": "2110010000000397EYM",
"payerName": "SABINA JOSHI",
"acquirerId": "00010001",
"localTransactionDateTime": "20210905205689635",
"amount": 200,
"merchantCity": "Kathmandu",
"encKeySerial": "475544545545444",
"acquirerCountryCode": "NP",
"terminal": "0",
"creditStatus": "DEFER",
"token": "<Signature Token>",
"transactionFee": 0,
"interchangeFee": 2,
"sessionSrlNo": 1485,
"narration": "Test",
"merchantCategoryCode": 5814,
"qrType": "STATIC",
"instructionId": "HBLQR-1633070857505",
"currencyCode": "NPR",
"payerMobileNumber": "9841******",
"addenda1":" addnField1 test data",
"addenda2":" addnField2 test data",
"addenda10":" addnField10 test data"
}

7.2.4. Response from NPI to Issuer Network

#Data ItemsTypeLengthRequiredRemarks
1responseCodeString10MResponse code for the transaction.
2responseMessageString200OHuman readable message for the response code.
3nQrTxnIdString20MUnique payment transaction id generated by NCHL.
4instructionIdString20MUnique reference id to trace the request by issuer.
5validationTraceIdString20MUnique QR validation/parse Id provided by NCHL.
6acquirerIdStringMAcquirer of the QR code.
7merchantPanStringMMerchant Id encrypted by public key provided by issuer.
8qrTypeENUMMStatic or Dynamic.
9amountNumeric(12,2)MAmount.
10interchangeFeeNumeric(10,2)MCharge if applicable else 0.00.
11transactionFeeNumeric(10,2)MIF additional cost to be paid by the customer for the transaction. else 0.00
12currencyCodeString3MCurrency symbol (eg. NPR).
13merchantBillNoString15MRequired if qrType is dynamic. Else 0.
14payerNameString200MName of the payer.
15payerPanIdStringMMobile Number, User Id, etc of payer uniquely identified in issuer system, encrypted by public key of NCHL.
16payerMobileNumberStringMMobile No of Payer.
17payerEmailAddressStringO
18issuerIdStringMIssuer id.
19debtorAccountStringMDebit account number encrypted by public key of NCHL.
20debtorAgentString4MBank Id.
21NarrationStringMax 20ONarration if any.
22acquirerCountryCodeString3MCountry Code NP
23merchantNameStringM
24merchantCityStringM
25merchantPostalcodeStringMMerchant’s Zip Code/Pin Code/Postal Code.
26merchantCountryCodeString3MCountry Code NP
27localTransactionDateTimeStringMYYYYMMDDHHmmssSSS.
28merchantCategoryCodeString4MMerchant category code (MCC).
29merchantTxnRefStringO
30InstrumentENUMCIPS-connectIPS, MOB-Mobile Banking, WAL-Wallet
31TerminalStringOTerminal id of the QR code. Else 0
32encKeySerialStringMSerial number of the public key used for encryption above
33addenda1-addenda10StringOAdditional fields 1 to 10 for future usages
34networkStringMNetwork identifier for the QR code
35tokenStringMSHA 256 Signature token
36npiBatchIdIntegerMRPS batch id
37npiTransactionIdIntegerMRPS transaction id
38creditStatusStringMCredit Status of Transaction
39debitStatusStringMDebit Status of Transaction
40debitDescriptionStringODebit Description
41creditDescriptionStringOCredit Description
Token String=nQrTxnId+”,”+validationTraceId+”,” +instructionId+ “,” + acquirerId +”,” + merchantPan +”,” +
merchantCategoryCode+”,”+amount+”,”+transactionFee+”,”+interchangeFee+”,”+currencyCode+”,”+
merchantName+”,”+merchantBillNo+”,”+terminal+”,”+issuerId+”,”+payerName+”,”+responseCode
Note:merchantPan in token string will be in plain text. merchantPan received in payment response from NPI first have to decrypt with the issuer private key.

For signature token verification, use NCHL public key.

Response Sample

{
"responseCode":"000",
"responseMessage":" Payment Transaction Successful",
"nQrTxnId":" 2108090000000583KMG",
"instructionId": "HBLQR-1628503975494",
"validationTraceId": "2108090000000147KFQ",
"acquirerId": "00000701",
"merchantPan": "<Encrypted Merchant PAN>",
"qrType": "DYNAMIC",
"amount": 10050.0,
"interchangeFee": 5.0,
"transactionFee": 0.0,
"currencyCode": "NPR",
"merchantBillNo": "001",
"payerName": "SABINA JOSHI",
"payerPanId": "<Encrypted Payer PAN>",
"payerMobileNumber": "9841******",
"payerEmailAddress": null,
"issuerId": "00000701",
"debtorAccount": "01908504580011",
"debtorAgent": "0701",
"debtorAgentBranch":"1",
"narration": "test",
"acquirerCountryCode": "977 || NP",
"merchantName": "Kathmandu Cafe",
"merchantCity": "Kathmandu",
"merchantCountryCode": "977 || NP",
"localTransactionDateTime": "20210905115532458",
"merchantCategoryCode": 1235,
"merchantTxnRef": "txn ref",
"instrument": "MOB",
"terminal": "Terminal1",
"encKeySerial": "6987968183376360924",
"token": "<Signature Token>",
"merchantPostalCode": "44601",
"addenda 1":" addnField1 test data",
"addenda2":"addnField2 test data",
"addenda 10":" addnField10 test data"
"npiBatchId": 712388659,
"npiTransactionId": 12715939,
"creditStatus": "DEFER",
"debitStatus": "00",
"debitDescription": "SUCCESS",
"creditDescription": "SUCCESS",
"network": NQR
}

7.3. Refund API

The participanting member should also have an API at their side to consume below APIs.

Post: /nQR/v1/refund

Refund API enabled the merchant acquirer to initiate the refund transaction.

Example Image

  1. Merchant initiates the refund transaction. Acquirer network sends the refund transaction to NPI.
  2. NPI will route the transaction to the Issuer network.
  3. Issuer will credit its customer and sends the response to NPI.
  4. NPI will send the notification to the refund initiating channel.

As a sub process of refund process, Acquirer will first check whether the original transaction session has been settled or not by accessing the session status API. If the transaction session is yet to be settled, refund request of such transaction will be identified as to be cancelled and not included in the settlement. However, if the transaction is already settled, refund request will initiate a new (refund) transaction against the original transaction. The system will not include the transactions in the settlement process in case of Refund as cancel.

7.3.1. Request from Acquirer to NPI

#Data ItemsTypeLengthRequiredRemarks
1orgnNQrTxnIdString20MOriginal nQrTxnId
2issuerIdStringMOriginal issuer id
3refundTypeStringMFULL/PARTIAL (PARTIAL is valid only in case of Refund not in cancellation)
4amountNumeric(12,2)MRefund Amount
5refundReasonCodeString10MRefund Reason
6refundReasonMessageString200OHuman readable message for the refundReasonCode
7instructionIdStringMUnique instruction id for the request from acquirer
8tokenStringMSHA256 signature token
Token String= orgnNQrTxnId +”,”+issuerId+”,”+amount+”,”+refundReasonCode+”,”+instructionId

For signature token signing, use acquirer private key

Request Sample

{
"orgnNQrTxnId": "2110010000000397EYM",
"issuerId": "00000701",
"refundType": "FULL",
"amount": 200,
"refundReasonCode": "R001",
"refundReasonMessage": "Service or Product Could not be delivered",
"instructionId": "ACQR-RFND-163307505",
"token": "<Signature Token>"
}

7.3.2. Request from NPI to Issuer Network

#Data ItemsTypeLengthRequiredRemarks
1orgnNQrTxnIdString20MOriginal nQrTxnId
2issuerIdStringMOriginal issuer id
3refundTypeStringMFULL/PARTIAL (PARTIAL is valid only in case of Refund not in cancellation)
4amountNumeric(12,2)MRefund Amount
5transactionFeeNumeric(10,2)MTransaction fee for refund. 0.00 if none.
6refundReasonCodeString10MRefund Reason
7refundReasonMessageString200OHuman readable message for the refundReasonCode
8instructionIdStringMUnique instruction id for the request from acquirer.
9refundCancellationFlgStringMR-Refund, C-Cancellation. Refund initiates new transaction for already settled txn and cancellation cancels the transaction that is waiting to be settled.
10refundNQrTxnIdString20MNew txn id if refund. Same txn id if Cancellation.
11payerPanIdStringMMobile Number or User Id which uniquely identifies payer in issuer system, encrypted by public key provided by issuer.
12payerMobileNumberStringMMobile No of Payer
13TokenStringMSHA256 signature token
Token String= orgnNQrTxnId+”,”+issuerId+”,”+amount+”,”+refundReasonCode+”,”+instructionId+”,”+
refundCancellationFlg+”,”+refundNQrTxnId+”,”+payerPanId

Note: payerPanId in token string will be in plain text. payerPanId received in refund request from NPI has to decrypt with the issuer private key.

For signature token signing, use NCHL public key

7.3.3. Response from Issuer Network to NPI

#Data ItemsTypeLengthRequiredRemarks
1orgnNQrTxnIdString20MOriginal nQRtxn Id
2issuerIdStringMOriginal issuer id
3refundTypeStringMFULL/PARTIAL
4amountNumeric12,2MRefund Amount
5transactionFeeNumeric10,2MTransaction fee for refund. 0.00 if none.
6refundReasonCodeString10MRefund Reason
7refundReasonMessageString200OHuman readable message for the refundReasonCode
8instructionIdStringMUnique instruction id for the request from acquirer.
9refundCancellationFlgStringMR-Refund, C-Cancellation. Refund initiates new transaction for already settled txn and cancellation cancels the transaction that is waiting to be settled.
10refundNQrTxnIdStringMNew txn id if refund. Same txn id if Cancellation.
11payerPanIdStringMMobile Number or User Id which uniquely identifies payer in issuer system, encrypted by public key provided by issuer.
12payerMobileNumberStringMMobile No of Payer
13responseCodeString10MResponse code for the request.
14responseMessageString200MHuman readable message for the provided response code.
15TokenStringMSHA256 signature token
Token String= orgnNQrTxnId+”,”+issuerId+”,”+amount+”,”+refundReasonCode+”,”+instructionId+”,”+
refundCancellationFlg+”,”+ refundNQrTxnId+”,”+payerPanId+”,”+responseCode
Note: payerPanId in token string will be in plain text. payerPanId received in refund request from NPI has to de decrypt with the issuer private key. And again, have to encrypt with NCHL public key and send back in refund response.

For signature token signing, use issuer private key.

7.3.4. Response from NPI to Acquirer Network

#Data ItemsTypeLengthRequiredRemarks
1orgnNQrTxnIdString20MOriginal nQRtxn Id
2issuerIdStringMOriginal issuer id
3refundTypeStringMFULL/PARTIAL
4AmountNumeric(12,2)MRefund Amount
5transactionFeeNumeric(10,2)MTransaction fee for refund. 0.00 if none.
6refundReasonCodeString10MRefund Reason
7refundReasonMessageString200OHuman readable message for the refundReasonCode
8instructionIdStringMUnique instruction id for the request from acquirer.
9refundCancellationFlgStringMR-Refund, C-Cancellation. Refund initiates new transaction for already settled txn and cancellation cancels the transaction that is waiting to be settled.
10refundNQrTxnIdStringMNew txn id if refund. Same txn id if Cancellation.
11responseCodeString10MResponse code for the request.
12responseMessageString200MHuman readable message for the provided response code.
13TokenStringMSHA256 signature token
Token String= orgnNQrTxnId+”,”+issuerId+”,” +amount+”,”+refundReasonCode+”,”+instructionId+”,” +
refundCancellationFlg+”,”+refundNQRTxnId+”,”+responseCode
Note:For signature token verification, use NCHL public key.

7.4. Reporting API

NEPALPAY QR Network members will have access to various reporting API related to Transaction and Reconciliation report, session query, etc. for the purpose of reporting and reconciliation of the transactions and payments.

Example Image

Post: /nQR/v1/settledsession

This reporting API is used to fetch the list of sessions in Retail Payment Switch(RPS) and their status based on settlement data and session serial. Sessions with status SETTLED to be considered for the reconciliation of QR transactions.

7.4.1. Query parameters

#Data ItemsTypeLengthRequiredRemarks
1sessionSrlnoIntegerCSession number to enquiry the status
2dateSettledStringCYYYY-MM-dd Format date to get all the sessions settled on that date

7.4.2. Response parameters

#Data ItemsTypeLengthRequiredRemarks
1sessionSrlnoIntegerMSession number
2StatusStringMSession Status (e.g. "ACTIVE", "SETTLED"). In order to cancel a transaction, the session must be in "ACTIVE" status.
3dateSettledStringCYYYY-MM-dd Format date to get all the sessions settled on that date.

Sample request

{
"dateSettled":"2021-11-15"
}

Sample response

{
"timestamp": "2022-01-16T07:33:08.383+0000",
"responseCode": "200",
"responseStatus": "SUCCESS",
"responseMessage": null,
"responseBody": [
{
"sessionSrlNo": 1559,
"status": "GENERATED",
"settlementDate": "2021-12-18",
"dateSettled": null
},
{
"sessionSrlNo": 1563,
"status": "SETTLED",
"settlementDate": "2021-12-18",
"dateSettled": null
}
]
}

7.4.3. Reconciliation report specifications

Post: /nQR/v1/report

This reporting API is used to fetch the list of all transactions of settled session based on session serial of particular issuer & acquirer

7.4.3.1. Query Parameters

#Data ItemsTypeLengthRequiredRemarks
1sessionSrlnoStringMSession number to enquiry the status
2issuerIdStringMNEPALPAY Issuer Id

7.4.3.2 Response Parameters

#Data ItemsTypeLengthRequiredRemarks
1sessionSrlnoStringSession number for the transaction.
2recDateDateDate of transaction recording.
3instructionIdString20Unique reference id to trace the request by issuer/acquirer.
4nQrTxnIdString20Unique payment transaction id generated by NCHL.
5acquirerIdStringAcquirer of the QR code.
6issuerIdStringIssuer id.
7networkStringNetwork of the QR code.
8issuerNetworkStringNetwork of the issuer.
9amountNumeric(12,2)Amount.
10interchangeFeeNumeric(10,2)Charge if applicable else 0.00.
11transactionFeeNumeric(10,2)IF additional cost to be paid by the customer for the transaction else 0.00.
12debitStatusStringPayer Account Debit status.
13creditStatusStringReceiver Account Credit status.
14PayerNameString200Name of the payer.
15transactionTypeStringPMT-Payment, RFND-Refund.
16payerMobileNumberStringMobile No of Payer.
17merchantNameStringMerchant Name.
18merchantTxnRefStringMerchant Transaction Reference.
19terminalStringTerminal id of the QR code.
20merchantBillNoStringBill No of merchant.

Request Sample

{
"sessionSrlNo":"1542",
"issuerId":"00004501"
}

Response Sample

{
"timestamp": "2021-08-10T11:14:41.893+0545",
"responseCode": "200",
"responseMessage": "SUCCESS",
"responseBody": [
{
"nQrTxnId": "2107230000000003XBI",
"tranType": "PMT",
"instructionId": "HBLQR-1191982838",
"issuerId": "00000701",
"acquirerId": "00000701",
"amount": 2200.11,
"transactionFee": 0.00,
"interchangeFee": 15.00,
"merchantName": "Merchant Name",
"merchantBillNo": "44454",
"merchantTxnRef": null,
"payerName": "Kiran Maharjan",
"payerMobileNumber": "+977-9849752010",
"debitStatus": "000",
"creditStatus": "DEFER",
"sessionSrlNo": 1214,
"recDate": "2021-07-23",
"terminal": "MOB",
"network": "NQR",
"issuerNetwork":"NQR"
},
{
"nQrTxnId": "2107230000000005LGB",
"tranType": "PMT",
"instructionId": "MBLQR-4589756",
"issuerId": "00001501",
"acquirerId": "00000701",
"amount": 10000.00,
"transactionFee": 0.00,
"interchangeFee": 53.25,
"merchantName": "Merchant Name",
"merchantBillNo": "0",
"merchantTxnRef": "56555",
"payerName": "Sudip Shah",
"payerMobileNumber": "+977-9851011596",
"debitStatus": "000",
"creditStatus": "CNCL",
"sessionSrlNo": 1214,
"recDate": "2021-07-23",
"terminal": "CIPS",
"network": "NQR",
"issuerNetwork":"NQR"
},
{
"nQrTxnId": "2107230000000004BIJ",
"tranType": "RFND",
"instructionId": "MOCO_RFND-12358",
"issuerId": "00001601",
"acquirerId": "00000701",
"amount": 500.00,
"transactionFee": 0.00,
"interchangeFee": 0.00,
"merchantName": "Merchant Name",
"merchantBillNo": "0",
"merchantTxnRef": "21072300000000423KIO",
"payerName": "Rakesh Pokheral",
"payerMobileNumber": "+977-9849752010",
"debitStatus": "000",
"creditStatus": "000",
"sessionSrlNo": 1214,
"recDate": "2021-07-23",
"terminal": "WAL",
"network": "NQR",
"issuerNetwork":"NQR"
},
{
"nQrTxnId": "2107230000000002FRR",
"tranType": "PMT",
"instructionId": "EVRSTQR-4545544",
"issuerId": "00001001",
"acquirerId": "00000701",
"amount": 300.25,
"transactionFee": 5.25,
"interchangeFee": 2.50,
"merchantName": "Merchant Name",
"merchantBillNo": "jjhd6",
"merchantTxnRef": null,
"payerName": "Jeevan Shrestha",
"payerMobileNumber": "+977-9851752010",
"debitStatus": "000",
"creditStatus": "DEFER",
"sessionSrlNo": 1214,
"recDate": "2021-07-23",
"terminal": "MOB",
"network": "NQR",
"issuerNetwork":"XXX"
}
]
}

7.4.4. Individual transaction report

Post: /nQR/v1/merchanttxnreport

Query parameters:

#Data ItemsTypeLengthRequiredRemarks
1validationTraceIdString20CUnique QR validation Id provided by NCHL during QR generation
2merchantIdStringMCreditor Id/Merchant Code
3acquirerId/issuerIdStringMAcquirer/Issuer of the QR code
4nQrTxnIdString20CUnique payment transaction id generated by NCHL
5instructionIdString20CUnique reference id to trace the request by issuer/acquirer
Response parameters:
#Data ItemsTypeLengthRequiredRemarks
1sessionSrlnoStringSession number for the transaction
2recDateDateDate of transaction recording
3instructionIdString20Unique reference id to trace the request by issuer/acquirer
4nQrTxnIdString20Unique payment transaction id generated by NCHL
5acquirerIdStringAcquirer of the QR code
6issuerIdStringIssuer id
7NetworkStringNetwork of the QR code
8issuerNetworkStringNetwork of the issuer
9AmountNumeric(12,2)Amount
10interchangeFeeNumeric(10,2)Charge if applicable else 0.00
11transactionFeeNumeric(10,2)IF additional cost to be paid by the customer else 0.00
12debitStatusStringPayer Account Debit status
13creditStatusStringReceiver Account Credit status
14PayerNameString200Name of the payer
15transactionTypeStringPMT-Payment, RFND-Refund
16payerMobileNumberStringMobile No of Payer
17merchantNameStringMerchant Name
18merchantTxnRefStringMerchant Transaction Reference
19TerminalStringTerminal id of the QR code
20merchantBillNoStringBill No of merchant

Request Sample

{
"validationTraceId":"2205260000001900KIY",
"acquirerId":"00001501",
"merchantId": "XTZABCZ",
"nQRTxnId":"123153131",
"instructionId":"24324145241"
}

Response Sample

{
"timestamp": "2021-08-10T11:14:41.893+0545",
"responseCode": "200",
"responseMessage": "SUCCESS"
"responseBody": [
{
"nQrTxnId": "2107230000000003XBI",
"tranType": "PMT",
"instructionId": "HBLQR-1191982838",
"issuerId": "00000701",
"acquirerId": "00000701",
"amount": 2200.11,
"transactionFee": 0.00,
"interchangeFee": 15.00,
"merchantName": "Merchant Name",
"merchantBillNo": "44454",
"merchantTxnRef": null,
"payerName": "Kiran Maharjan",
"payerMobileNumber": "+977-9849752010",
"debitStatus": "000",
"creditStatus": "114",
"sessionSrlNo": 1214,
"recDate": "2021-07-23",
"terminal": "MOB",
"network": "NQR",
"issuerNetwork":"NQR"
},
{
"nQrTxnId": "2107230000000003XBI",
"tranType": "PMT",
"instructionId": "HBLQR-1191982838",
"issuerId": "00000701",
"acquirerId": "00000701",
"amount": 2200.11,
"transactionFee": 0.00,
"interchangeFee": 15.00,
"merchantName": "Merchant Name",
"merchantBillNo": "44454",
"merchantTxnRef": null,
"payerName": "Kiran Maharjan",
"payerMobileNumber": "+977-9849752010",
"debitStatus": "000",
"creditStatus": "DEFER",
"sessionSrlNo": 1214,
"recDate": "2021-07-23",
"terminal": "MOB",
"network": "NQR",
"issuerNetwork":"NQR"
}
]
}
Note:
  1. For the finality of transaction, kindly consider debitStatus 000 and creditStatus (‘000’,’DEFER’ and 999).
  2. If validation trace id is used as input parameter for transaction query, there can have more than one record for same validation traceid. For example, in case of dynamic QR, the validation trace id is fixed during QR generated. Customer can make the multiple payments if earlier made payment is failed. Now the response will be the details of earlier failed and current success transaction as well. This will help to identiify the number of transactions made for same validation trace id with their corresponding status.

7.5. Merchant QR Generation

Merchant QR generation process includes the interface between the merchant system and NEPALPAY QR network. This API provides the flexibility for merchants to select either a base64 encoded dynamic QR Image itself or a QR String as the output.This interface specification describes a technical level communication of data exchange between the merchant system and the NEPAYPAY QR system.

7.5.1. Authentication and Authorization

Basic Authentication is a common method of authenticating to an API. The client sends HTTP requests with the Authorization header that contains the Basic word followed by a space and a base64-encoded username: password string.

Header key = 'Authorization'

Value = 'Basic '+ base 64 encoding of a username and password separated by a colon.

Authorization: Basic ZGVtbzpwQDU1dzByZA==

Example:

curl --location 'https://<host: port>/qr/generateQR' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic cGxhem1hdDpBYmNkQDEyMw==' \
--data '{
"pointOfInitialization": 12,
"acquirerId": "00002501",
"merchantId": "2501ELFDRY2",
"merchantName": "Plazma Tech",
"merchantCategoryCode": 4121,
"merchantCountry": "NP",
"merchantCity": "Kathmandu",
"merchantPostalCode": "4600",
"merchantLanguage": "en",
"transactionCurrency": 524,
"transactionAmount": "10.00",
"valueOfConvenienceFeeFixed": "0.00",
"billNumber": "012345",
"referenceLabel": null,
"mobileNo": null,
"storeLabel": "Store1",
"terminalLabel": "Terminal1",
"purposeOfTransaction": "Bill payment",
"additionalConsumerDataRequest": null,
"loyaltyNumber": null,
"token": "a1e0pTCtdgqny2BBPgKT/9EaLrRA0J99PYlNyjM5887nkebzvaKtsHT/aciZxXmqsnYMnktXJmseFIsiyE+06476RXrQaCNLEZ4LvsraSz5VWrb/ysA5HgFMqcXyRVCYkC4Ye5Uqbi87wbEyj1bb6Cb2yqDAOGm4uGmn7T5W9Gc="
}'

Post: /qr/generateQR

Request from Merchant to NPI for QR generation

#Data ItemsTypeLengthRequired Remarks
1pointOfInitialization Integer2 M Point of Initiation Method (Use 11 for static QR and 12 for Dynamic QR)
2acquirerIdString MAcquirer of the QR code
3merchantIdStringMCreditor Id/ Merchant Code
4merchantName String25MMerchant Name
5merchantCategoryInteger4MMerchant Category Code
6merchantCityStringMCity
7merchantCountryStringMCountry code
8merchantPostalCodeString M Merchant’s Zip Code/Pin Code/Postal Code
9transactionCurrencyInteger3MCurrency code (eg. 524 for Nepali rupee)
10transactionAmountNumeric(12,2)MAmount. 0.00 if none.
11valueOfConvenienceFeeFixedNumeric(10,2)O Transaction Fee, if the transaction costs additional fee for the customer.
12billNumberString 25O Bill No of merchant. 0 if none.
13referenceLabelString 25O
14storeLabelString 25M Store label of the QR code.
15terminalLabelString 25O Terminal id of the QR code.0 if none.
16purposeOfTransactionString 25OPurpose of transaction.
17addenda1-addenda10 String 25O Additional fields 1 to 10 for additional usages.
18qrImage Boolen Cfalse: QR string will be provided (by default) true: QR image will be provided.
19TokenString MSHA 256 Signture Token

Request Sample:

{
"pointOfInitialization": 12,
"acquirerId": "00001701",
"merchantId": "17012UVSTIR",
"merchantName": "BBSM",
"merchantCategoryCode": 5021,
"merchantCountry": "NP",
"merchantCity": "Kathmandu",
"merchantPostalCode": "4600",
"merchantLanguage": "en",
"transactionCurrency": 524,
"transactionAmount": "0.00",
"valueOfConvenienceFeeFixed": "0.00",
"billNumber": "012345",
"referenceLabel": null,
"mobileNo": null,
"storeLabel": "Store1",
"terminalLabel": "Terminal1",
"purposeOfTransaction": "Bill payment",
"additionalConsumerDataRequest": null,
"loyaltyNumber": null,
"qrImage": false,
"token": "PcK7JFPfEUvtGouuShjQgten7HQsAxxGVZJ+38ORzEOCEMV3Dlt7V0M7g+HUBfn0+oHZqAsb2p
zTQHWEQPLmPOGR4lVEoy581vYmN5PfMLSQqb/UxixT1O4X6ZFeV9sVivP3Y1gVfILPIzRm2CfML4BTHhDl
pNvoOQ840nvNn2E="
}
TokenString: acquirerId+”,“+merchantId +”,“+merchantCategoryCode+”, “+transactionCurrency+”,“+transactionAmount+”,“+billNumber+”,“+userId
Note: userId is a NPI user provided to the merchant.

Successful Response When qrImage Tag Is False:

{
"timestamp": "2022-05-23 04:25:26",
"responseCode": "000",
"responseStatus": "SUCCESS",
"responseMessage": "QR String generated successfully.",
"data": {
"validationTraceId":"2205260000001900KIY",
"qrString": "01021229270023NCHL0000170117012UVSTIR52045021530352454040.0056040.005802N
P5904BBSM6009Kathmandu6271010100306Khalti0709Terminal10812Bill payment512300192205260000001
900KIY6304607F”
}
}

The highlighted section above is the sub tag 51 of field 62 which is validation id generated by NCHL during QR generation. This validation trace id will be used for end to end reporting and reconciliation.

Response

S.N.Data ItemsTypeLengthRequiredRemarks
1validationTraceIdString20MUnique QR validation Id provided by NCHL during QR generation. It will be used for end-to-end reporting and reconciliation.
2qrStringString-QR string to be used for QR generation and display.
Unsuccessful Response

You will get error details in responseResult (i.e. responseCode, responseDescription and fieldErrors) respectively.

Successful Response When qrImage Tag Is True:

The highlighted section above is the sub tag 51 of field 62 which is validation id generated by NCHL during QR generation. This validation trace id will be used for end to end reporting and reconciliation.

Response

S.N.Data ItemsTypeLengthRequiredRemarks
1validationTraceIdString20MUnique QR validation Id provided by NCHL during QR generation. It will be used for end to end reporting and reconciliation.
2qrStringString--QR string to be used for QR generation and display.
3qrImageStringCBase64 encoded QR Image
{
"timestamp": "2024-01-09 11:44:40",
"responseCode": "000",
"responseStatus": "SUCCESS",
"responseMessage": "QR String generated successfully.",
"data": {
"qrString":
"01021229270023NCHL000023012301JR0R2KT52044111530105406290.14560105802NP5907BigMart6009
Kathmandu62830109ABC0001540312Bikash
Saran0409A123412340710ConnectIPS512300192401090000204270ZTV6304EC0E",
"validationTraceId": "2401090000204270ZTV",
"qrImage":
"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
MVFH1AAAAAElFTkSuQmCC"
}
}

Sample QR Image:

To generate the QR image, decode the output of qrImage tag above with base64 to Image.

Example Image

Failed Response:

  {
"responseCode": "400",
"responseDescription": "PARAMETER VALIDATION ERROR",
"fieldErrors": [
{
"field": "pointOfInitialization",
"message": "Please use (11 for static QR and 12 for dynamic QR)."
}
]
}
{
"responseCode": "E003",
"responseMessage": "INVALID TOKEN",
"data": "",
"classfielderrorlist": []
}

Not Found

    {
"responseCode": "E010",
"responseMessage": "RECORD NOT FOUND:- Merchant not found!",
"data": null,
"classfielderrorlist": []
}

Internal Server Error -500

    {
"responseCode": "E999",
"responseMessage": "ERROR",
"data": null,
"classfielderrorlist": []
}

In case of service not available

    {
"timestamp": "2022-05-26 04:07:22",
"responseCode": "E999",
"responseMessage": "ERROR",
"data": null
}

7.6. Merchant Register in NEPALPAY QR scheme

Merchant onboarded by third party acquirer under NEPALPAY QR specification through their merchant management system (MMS) is required to register in NEPALPAY QR scheme. Merchant registration is required for reporting purpose and verification of merchant during merchant settlement. Merchants can be registered either in a bulk or individually as per below specification.

POST URL: /nQR/v1/merchant/register

Request Parameters

S.NField NameData TypeLengthPresenceDescription
1instructionIdString20YUnique reference id to trace the merchant registration.
2acquirerIdStringYAcquirer of QR merchant.
3merchantDetailListYList of merchants
3.1merchantPanString20YMerchant PAN number
3.2merchantNameString25YMerchant common name
3.3merchantCategoryCodeString4YMerchant category code (MCC)
3.4merchantAddressString150YMerchant address
3.5terminalIdString50YTerminal id
3.6regDateStringYMerchant registration date (yyyy-MM-dd)
3.7statusString1YStatus of merchant (A=Active, I=Inactive)
TokenString: instructionId+","+acquirerId+","+userId
Note: userId is a NPI user provided to the merchant.

Sample Request

  {
"instructionId": "123454321",
"acquirerId": "54321",
"merchantDetail": [
{
"merchantPan": "12345",
"merchantName": "Merchant name 1",
"merchantCategoryCode": "1111",
"merchantAddress": "Kathmandu",
"terminalId": "12345678",
"regDate": "2000-01-01",
"status": "A"
},
{
"merchantPan": "67890",
"merchantName": "Merchant name 2",
"merchantCategoryCode": "2222",
"merchantAddress": "Lalitpur",
"terminalId": "98765432",
"regDate": "2010-10-10",
"status": "I"
}
],
"token": "PcK7JFPfEUvtGouuShjQgten7HQsAxxGVZJ+38ORzEOCEMV3Dlt7V0M7g+HUBfn0+oHZqAsb2p
zTQHWEQPLmPOGR4lVEoy581vYmN5PfMLSQqb/UxixT1O4X6ZFeV9sVivP3Y1gVfILPIzRm2CfML4BTHhDl
pNvoOQ840nvNn2E="
}

Success Response

{
"responseCode": "000",
"responseMessage": "SUCCESS",
"responseData": "Successfully Registered",
"responseErrors": {}
}

Failed Response

  {
"responseCode": "E007",
"responseMessage": "TECHNICAL VALIDATION FAILED",
"data": null,
"classfielderrorlist": [
{
"field": "merchantDetail[0].merchantPan",
"message": "Merchant with pan number '12345' for Acquirer '54321' already exist."
},
{
"field": "merchantDetail [1].merchantPan",
"message": "Merchant with pan number '67890' for Acquirer '54321' already exist."
}
]
}
POST URL: /nQR/v1/merchant/status/change

This API is used to update the status of already registered merchant in NEPALPAY QR ascheme. Request parameter and token string are same as merchant register API as above.

Sample Request

  {
"instructionId": "123454321",
"acquirerId": "54321",
"merchantDetail": [
{
"merchantPan": "12345",
"merchantName": "Merchant name 1",
"merchantCategoryCode": "1111",
"merchantAddress": "Kathmandu",
"terminalId": "12345678",
"regDate": "2000-01-01",
"status": "A"
},
{
"merchantPan": "67890",
"merchantName": "Merchant name 2",
"merchantCategoryCode": "2222",
"merchantAddress": "Lalitpur",
"terminalId": "98765432",
"regDate": "2010-10-10",
"status": "I"
}
],
"token": "PcK7JFPfEUvtGouuShjQgten7HQsAxxGVZJ+38ORzEOCEMV3Dlt7V0M7g+HUBfn0+oHZqAsb2p
zTQHWEQPLmPOGR4lVEoy581vYmN5PfMLSQqb/UxixT1O4X6ZFeV9sVivP3Y1gVfILPIzRm2CfML4BTHhDl
pNvoOQ840nvNn2E="
}
Note: A = Active, I = Inactive

Success Response

  {
"responseCode": "000",
"responseMessage": "SUCCESS",
"responseData": "Successfully updated merchant status.",
"responseErrors": {}
}

Failed Response


{
"responseCode": "E007",
"responseMessage": "TECHNICAL VALIDATION FAILED",
"data": null,
"classfielderrorlist": [
{
"field": "merchantDetail [1]. merchantPan",
"message": "Must not be null or empty."
}
]
}

7.7. Payment Confirmation API Details

This API serves as the channel for payment confirmation from NEPALPAY QR engine after successful QR transaction. It is specifically designed for service providers who have integrated NEPALPAY Dynamic QR as their payment instrument. The respective merchant service providers must have exposed the API according to the following specification.

POST URL: /nepalpay/confirm-payment

Authorization: Basic Auth

Request Signature Generation: The signature string will be the combination of request parameters in the following format.

Signature String = <merchantBillNo>+”,” +<merchantId>+”,” +<merchantName>+”,” +<paymentRef>+”,
+<channel>+”,” +<payerMobileNumber>+”,” +<sessionNo>
  1. Sign the token string using the digital certificate private key (pfx file/keystore). The digital signature algorithm will be the SHA256 with RSA.
  2. Convert the signed token above in step 2 to base64 encoding.
  3. Pass this signature string to the “signature” field of the request message.

Response Token Generation:

The signature string is the combination of response parameters in the following format.

Token String = < txnDate >+”,” +< status >+”,” +< message >+”,” +< mchantBillNo >+”,” +< paymentRef >
  1. Sign the token string using the digital certificate private key (pfx file/keystore). The digital signature algorithm will be the SHA256 with RSA.
  2. Convert the signed token above in step 2 to base64 encoding.
  3. Pass this signature string to the “signature” field of the request message.

Request Parameters:

S.NParamsTypeLengthPresenceDescription
1txnDateStringMTransaction date. Format (yyyy-MM-dd HH:mm:ss)
2txnAmountNumeric12,2MTransaction amount
3chargeAmtNumeric12,2MCharge amount
4merchantIdString25MMerchant code
5storeLabelString25OStore label of QR code
6terminalIdString10OTerminal label of QR code
7merchantNameString25MMerchant name
8rpstxnIdNumericMTransaction id from Network side
9validationTraceIdString20MUnique QR validation Id provided by NCHL during QR generation. It will be used for end-to-end reporting and reconciliation.
10paymentRefAlpha-Numeric35MUnique QR validation Id. It will be used for end-to-end reporting and reconciliation
11merchantBillNoStringMBill no./ Unique code or Id enough for transaction reconciliation
12statusString10MTransaction status (SUCCESS|PENDING|FAILED)
13statusDescString50MTransaction status description
14remarksString100MRemarks for transaction
15signatureStringMSHA256 signature token
16channelString10MIssuer channel e.g. CIPS|MB|WAL
17payerMobileString10MPayer Mobile Number
18sessionNoNumericMUnique session id
19extraPaymentParamsMap(K,V)MExtra parameters to identify transaction. Params can be in the form of key-value pair

Sample Request

  {
"txnDate": "2023-12-12 10:05:11",
"txnAmount": 100.0,
"chargeAmt": 2.00,
"merchantId": "2301NERGYKC",
"storeLabel": "Bhaisepati",
"terminalId": "Terminal1",
"merchantName": "Dish Home Nepal",
"rpstxnId": 12422440,
"validationTraceId":" MIMJGNIONIBGUBUBDSN"
"paymentRef": "NCHfcb3f2075403a88f4d4b81d2b4424000",
"merchantBillNo": "4d4b81d2b4424000",
"status": "SUCCESS",
"statusDesc": "TRANSACTION SUCESSFULL",
"remarks": "Dish Home Payment 1 month",
"signature":"
PcK7JFPfEUvtGouuShjQgten7HQsAxxGVZJ+38ORzEOCEMV3Dlt7V0M7g+HUBfn0+oHZqAsb2pzTQHWEQ
PLmPOGR4lVEoy581vYmN5PfMLSQqb/UxixT1O4X6ZFeV9sVivP3Y1gVfILPIzRm2CfML4BTHhDlpNvoOQ84
0nvNn2E=",
"channel": "CIPS",
"payerMobile": "9849428177",
"sessionNo": "1234",
"extraPaymentParams":
{
"customerName": "Rajim Ali Miya",
"address": "Gulumi ",
"txnCrncy": "NPR"
}
}

Sample Response

  {
"txnDate": "2023-12-12 10:05:11",
"status": "SUCCESS",
"message": "TRANSACTION SUCESSFULL",
"merchantBillNo": "4d4b81d2b4424000",
"paymentRef": "NCHfcb3f2075403a88f4d4b81d2b4424000",
"signature":"Ghxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=”
}